<?php

function smarty_function_get_category_by_id($params, &$smarty) 
{
  $cat_id = $params['cat_id'];
      $pntables = pnDBGetTables();

  if(isset($cat_id)){
    //Query data
    $sql = "SELECT
              ctg_name
            FROM ".
              $pntables[ishopstore_categories]
            ." WHERE
              ctg_id = ".$cat_id;

    $column = array("name");
    $result = DBUtil::executeSQL($sql);
    $objectArray = DBUtil::marshallObjects ($result, $column);
    $smarty->assign("cat_name", $objectArray[0]['name']);
    }

}
